package com.iseastar.dianxiaosan.utils;

import com.iseastar.dianxiaosan.model.StampBean;

import java.util.Comparator;

/**
 * Created by joker on 2017/6/12.
 * 根据邮票可抵消的包裹数量排序
 */
public class StampParcelCountSort implements Comparator<StampBean> {

    @Override
    public int compare(StampBean o1, StampBean o2) {

        int stampParcelCount1 = o1.getParcelCount();
        int stampParcelCount2 = o2.getParcelCount();
        if (stampParcelCount1 < stampParcelCount2) {
            return 1;
        } else if (stampParcelCount1 > stampParcelCount2) {
            return -1;
        } else {
            return 0;
        }
    }
}
